package com.atguigu07._abstract;

public class t {
    public static void main(String[] args) {
        getprime getprime=new getprime();
        getprime.time();

    }
}

abstract class get{

    public void time(){
    long start=System.currentTimeMillis();
    code();
    long end=System.currentTimeMillis();
        System.out.println("时间为"+(end-start));
    }

    public abstract void code();
}

class getprime extends get{
    public  void code(){
        for (int i = 2; i <=10000; i++) {
            for (int j = 2; j <=Math.sqrt(i) ; j++) {
                if(i%j==0){
                    System.out.println(i);
                    break;
                }
            }
        }

    }
}


